home *** CD-ROM | disk | FTP | other *** search
- //////////////////////////////////////////////////////////////////////
- // Pocket PC Game Programming
- // Chapter 9: Sprites and Animation
- //
- // CBitmap Header File
- //
- // This file includes the CBitmap class definition.
- //
- //////////////////////////////////////////////////////////////////////
-
- #pragma once
-
- class CBitmap
- {
- protected:
- HDC hScreenDC;
- LPBYTE lpDIB;
- LPBYTE lpSourceBits;
- LPBITMAPINFO lpbmi;
- DWORD dwImageSize;
- BITMAP bmBitmap;
- LPTSTR lpBitmapFN;
- HDC hSourceDC;
- HBITMAP hOldBitmap;
-
- BOOL LoadDIB(LPCTSTR szFileName);
- LPSTR BitmapDataIndex(LPSTR lpbi);
- int PaletteSize(LPSTR lpbi);
- int BytesPerLine(LPBITMAPINFOHEADER lpBMIH);
-
- public:
- CBitmap() { };
- CBitmap(HDC hdc);
- virtual ~CBitmap();
- virtual HDC GetSourceDC() { return hSourceDC; };
- virtual BOOL BitBlit(HDC hdc, int x, int y);
- virtual BOOL BitBlit(int x, int y);
- virtual BOOL StretchBlit(int x, int y, int dx, int dy);
- virtual BOOL TransBlit(int x, int y, COLORREF clrTrans);
-
- LPTSTR GetFilename() { return lpBitmapFN; };
- void SetFilename(LPTSTR lpFN) { lpBitmapFN = lpFN; };
- HDC GetScreenDC() { return hScreenDC; };
- void SetScreenDC(HDC hNew) { hScreenDC = hNew; };
-
- BOOL Create(int Width, int Height);
- BOOL Load(LPTSTR lpFilename);
- int BitCount();
- virtual int ImageWidth();
- virtual int ImageHeight();
- int NumPlanes();
-
- };
-
-